package com.kupal.ahk;

import net.sourceforge.jwbf.core.actions.util.ActionException;
import net.sourceforge.jwbf.core.actions.util.ProcessException;
import net.sourceforge.jwbf.core.contentRep.ArticleMeta;
import net.sourceforge.jwbf.core.contentRep.ContentAccessable;
import net.sourceforge.jwbf.core.contentRep.SimpleArticle;
import net.sourceforge.jwbf.mediawiki.bots.MediaWikiBot;

import java.net.MalformedURLException;

/**
 * @author Krauchenia Sergey
 *         Date: 13.10.2010
 *         Time: 12:59:41
 */
public class Runner {

    public static void main(String[] args) {
        try {
            MediaWikiBot bot = new MediaWikiBot("http://188.241.116.213/mediawiki/");
            bot.login("kupalBot", "cfdhjy");
            SimpleArticle article = new SimpleArticle();
            article.setTitle("Test_article");
            article.setText("== hello ==");
            bot.writeContent(article);
            bot.getSiteinfo();

            System.out.println(bot.getVersion());
        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (ActionException e) {
            e.printStackTrace();
        } catch (ProcessException e) {
            e.printStackTrace();
        }
    }
}
